<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // arr.some(function(val,index,arr){})
        // 返回一个布尔值  true/false
        // 在数组中查找某个元素是否存在
        var arr = [1,2,5,8,9];
        var flag = arr.some(function(val,index,arr){
            return val == 5;

        });
        console.log("是否存在::"+flag);
    </script>
</body>
</html>